package demo;


import demo.standard.FlyWeightFactory;
import demo.standard.IFlyWeight;
import demo.standard.UnSharedConcreteFlyWeight;

public class ClientForStandard {

    public static void main(String[] args) {

        IFlyWeight a = FlyWeightFactory.getFlyWeight("test1");
        IFlyWeight b = FlyWeightFactory.getFlyWeight("test1");
        System.out.println("两个共享对象是否相等:" + (a == b));
        b.use("A");

        System.out.println();
        UnSharedConcreteFlyWeight unSharedConcreteFlyWeight = new UnSharedConcreteFlyWeight();
        unSharedConcreteFlyWeight.use("B");
    }
}
